package com.hs.sfzy.controller;

import com.hs.sfzy.entity.UpdateSpecialtyRequest;
import com.hs.sfzy.service.ConsultSpecialtyService;
import com.hs.sfzy.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @ClassName ConsultSpecialtyController
 * @Description 咨询师与擅长领域的修改
 * @Author 李明辉
 * @Date 2024年10月25日 9:23
 * @Version 1.0
 */
@RestController
@RequestMapping("/consultspecialty")
public class ConsultSpecialtyController {
    @Autowired
    private ConsultSpecialtyService specialtyService;
    @PostMapping("/updateSpecialty")
    public Result<String> updateSpecialty(@RequestBody UpdateSpecialtyRequest request) {
        Long consultId = request.getConsultId();
        List<Long> specialtyIds = request.getSpecialtyIds();
        specialtyService.updateSpecialtyByConsultId(consultId, specialtyIds);
        return Result.success("修改成功");
    }
}
